<?php

/**
 * Preciocomb form base class.
 *
 * @method Preciocomb getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BasePreciocombForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'fecha1'    => new sfWidgetFormInputHidden(),
      'proveedor' => new sfWidgetFormInputHidden(),
      'estacion'  => new sfWidgetFormInputHidden(),
      'moneda'    => new sfWidgetFormPropelChoice(array('model' => 'Moneda', 'add_empty' => false)),
      'uMedida'   => new sfWidgetFormPropelChoice(array('model' => 'Unidmedida', 'add_empty' => false)),
      'tipoComb'  => new sfWidgetFormInputHidden(),
      'precio'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'fecha1'    => new sfValidatorChoice(array('choices' => array($this->getObject()->getFecha1()), 'empty_value' => $this->getObject()->getFecha1(), 'required' => false)),
      'proveedor' => new sfValidatorPropelChoice(array('model' => 'Proveedor', 'column' => 'rif', 'required' => false)),
      'estacion'  => new sfValidatorPropelChoice(array('model' => 'Estacion', 'column' => 'codigo', 'required' => false)),
      'moneda'    => new sfValidatorPropelChoice(array('model' => 'Moneda', 'column' => 'id')),
      'uMedida'   => new sfValidatorPropelChoice(array('model' => 'Unidmedida', 'column' => 'simbolo')),
      'tipoComb'  => new sfValidatorPropelChoice(array('model' => 'Tipocomb', 'column' => 'nombre', 'required' => false)),
      'precio'    => new sfValidatorNumber(),
    ));

    $this->widgetSchema->setNameFormat('preciocomb[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Preciocomb';
  }


}
